package com.gxa.modules.io.controller;

import com.gxa.modules.io.entity.companyInfo;
import com.gxa.modules.io.utils.ExcelUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @Description:
 * @Author: zhuiyi
 * @CreatTime: 2022/11/2 20:19
 **/
@Slf4j
public class IoController {

    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public void importExcel(@RequestParam(value = "uploadFile", required = false) MultipartFile file) {
        //导入转换成实体的list
        List<companyInfo> userModelList = ExcelUtils.readExcel("", companyInfo.class, file);
       //转成list后处理自己的业务
        log.info("---------userModelList----{}------",userModelList);
    }
}
